home *** CD-ROM | disk | FTP | other *** search
- Path: news.infi.net!usenet
- From: nngis@norfolk.infi.net (Greg DiGiorgio)
- Newsgroups: comp.lang.c
- Subject: Re: c/dos memory allocation mixing ?
- Date: 18 Jan 1996 15:00:38 GMT
- Organization: Customer of InfiNet
- Message-ID: <4dlnam$7af@news.infi.net>
- References: <4dfmp4$678@thor.atcon.com>
- Reply-To: nngis@norfolk.infi.net
- NNTP-Posting-Host: h-hengest.norfolk.infi.net
- Mime-Version: 1.0
- X-Newsreader: WinVN 0.99.3
-
- In article <4dfmp4$678@thor.atcon.com>, aa176@ccn.cs.dal.ca says...
- >
- >Is there a problem with mixing C and dos memory allocation? This is
- >the only thing I can think of that might be messing up my program but
- >I really need to do this. Any help GREATLY appreciated!!! I've had
- >this bug at the back of my mind for months and it's time to solve it
- >once and for all. I need a life again!
- >
-
- How does one "mix" DOS and C memory allocation. When you use "malloc",
- your compiler includes the routines needed to allocate memory from DOS
- within your C program. In fact, much of the code that the compiler wraps
- around your program (and it's substantial) is devoted to memory
- management.
-
- Therefore, using "malloc" does what you want. Now, if you are programming
- in, say, Windows V3.1 - don't use "malloc", use the Windows routine to
- alloc memory. In this case, you would be mixing DOS and 'C' memory alloc,
- so to speak - and it would not be a good idea.
-
- Hope this helps,
- Greg DiGiorgio
-
-